﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoGame.GameLib.Entities;
using ProtoGame.GameLib;
using ProtoGame.DescritoresContent;

namespace ProtoGame.Sprites
{
    class PGCanoFurado : AnimatedSprite
    {
        public event EventHandler Remendou;

        void OnRemendou()
        {
            if (Remendou != null)
                Remendou(this, EventArgs.Empty);
        }

        public PGCanoFurado(Tileset gfx, Animator animations)
            : base(animations, gfx)
        {
            AnimationState = PGIMGMontanha.EstadosCanoFurado.Seco;
        }

        public override void DoCollision(byte collisionType)
        {
            if (collisionType == TiposColisoes.Jogador)
            {
                if (AnimationState == PGIMGMontanha.EstadosCanoFurado.Vasando)
                {
                    AnimationState = PGIMGMontanha.EstadosCanoFurado.Remendado;
                    OnRemendou();
                }
            }

        }

        public bool Vazando
        {
            set { if (value) AnimationState = PGIMGMontanha.EstadosCanoFurado.Vasando; }
        }
    }
}
